#define THIS_FILE "ramasser.sqf"
#include <base\tmf_constants.h>
#include <base\tmf_macros.h>
WAITINIT(ramasser);

// ["RoadCone_F","marker1"] execVM "ramasser.sqf";
if (!isServer) exitWith {};
private ["_type","_marker","_error","_obj_params","_obj_params","_item_desc","_pickup_msg"];
DEFAULT_PARAM(_type,0,"");
DEFAULT_PARAM(_marker,1,"");
DEFAULT_PARAM(_item_desc,2,(ARR_1(_type) call CFUNC(displayName)));
DEFAULT_PARAM(_pickup_msg,3,ARR_2("STR_TYR_TARGET_PICKEDUP","__CALLER__"));

_error = false;
if (IS_STRING(_type)) then { _error = (_type == "") };
if (IS_STRING(_marker)) then { _error = (_marker == "") };
if (_error) exitWith {};

_obj_params = [];
_obj_params set [TMF_VEH_PARAMS_TYPE, _type];
_obj_params set [TMF_VEH_PARAMS_POS, _marker];

_tmf_params = [];
_tmf_params = [_tmf_params,"ITEM_DESC",_item_desc] call CFUNC(hashSet);
_tmf_params = [_tmf_params,"PICKUP_MSG",_pickup_msg] call CFUNC(hashSet);
//_tmf_params = [_tmf_params,"SHARED_VAR","jip_pickedup"] call CFUNC(hashSet);
//_tmf_params = [_tmf_params,"SHARED_VAR_VAL",true] call CFUNC(hashSet);
_tmf_params = [_tmf_params,"PICKUP_TITLE","STR_MF_PICKUP_DEFACTION"] call CFUNC(hashSet);
//_tmf_params = [_tmf_params,"PICKUP_CODE",""] call CFUNC(hashSet);

OBJ = [_obj_params,"PICKUP",_tmf_params] call FFUNC(CreateMissionObject);
